<?php
/**
 * Created by PhpStorm.
 * User: yuyiwen
 * Date: 2018/9/20
 * Time: 下午2:59
 */

namespace app\index\validate;

use think\Validate;

class Member extends Validate
{
    protected $rule = [
        'username'  =>  'require',
        'pwd'  =>  'require|min:6|confirm:repwd',
        'phone' => 'require|length:11|number'
    ];

    protected $message  =   [
        'username.require' => '用户名不能为空！！！！',
        'pwd.require' => '密码不能为空！！！！',
        'pwd.min' => '密码不能小于6位',
        'pwd.confirm' => '密码与确认密码不相等',
        'phone.require' => '手机号码不能为空',
        'phone.length' => '手机号码长度必须是11位',
        'phone.number' => '输入了非数字',
//        'phone.unique'
    ];

    protected $scene = [
        'check_phone' => ['phone']
    ];
}